<el-dialog title="编辑员工" id="edit" v-model="editFormDialog" @open='beforeEdit'>
<!-- <el-form :model="form"> -->
<el-form ref="editForm" :rules="editRules" :model="editForm" :label-width="dialogLabelWidth">
    

    <el-tabs  type="card" >
      <el-tab-pane label="基本信息" name="first">
        <el-row>
          <el-col :span="12">
            <el-form-item label="登录账号" prop="account">
              <el-input v-model="editForm.account"  :disabled="true" auto-complete="off"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="员工姓名" prop="realname">
              <el-input v-model="editForm.realname" auto-complete="off"></el-input>
              
            </el-form-item>
          </el-col>
        </el-row>
        
        <el-row v-if="departmentItem==1">
          <el-col :span="12">
            <el-form-item label="所属部门" prop="department_id">
              <el-select v-model="editForm.department_id">
                <el-option v-for="department in allDepartments" :label="department.name" :value="department.id"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="性别">
              <el-radio class="radio" v-model="editForm.sex" label="1">男</el-radio>
              <el-radio class="radio" v-model="editForm.sex" label="2">女</el-radio>
            </el-form-item>
          </el-col>
        </el-row>


        <el-row>
          <el-col :span="12">
            <el-form-item label="头像">
            <img v-show='editUploadImg' :src="editUpload" alt="" style="max-width: 200px; max-height: 200px;">
              <el-upload
               action="{:U('Upload/index2')}" 
               accept="image/jpeg,image/png,image/jpg,image/gif,image/bmp"
               :on-success="editFormUploadSuccess" 
               :on-error="addFormUploadError" 
               :data="pathInfo"
               :headers="xuploadheader"
               :multiple="false"
               :show-upload-list="false">
              <el-button size="small" type="primary">点击上传</el-button>
            </el-upload>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="12">
            <el-form-item label="手机" prop="mphone">
              <el-input v-model="editForm.mphone"  auto-complete="off"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="固话" prop="phone">
              <el-input v-model="editForm.phone" auto-complet="off"></el-input>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="12">
            <el-form-item label="QQ号" prop="qq">
              <el-input v-model="editForm.qq" auto-complete="off"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="QQ昵称">
              <el-input v-model="editForm.qq_nickname" auto-complet="off"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="微信号">
              <el-input v-model="editForm.weixin" auto-complete="off"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="微信昵称">
              <el-input v-model="editForm.weixin_nikname" auto-complet="off"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="身份证号">
              <el-input v-model="editForm.id_card" auto-complet="off"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="区县">
              <el-select v-model="editForm.area_district" placeholder="请选择">
                <el-option v-for="dis in districts" :label="dis.name"  :value="dis.id"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="省份">
              <el-select ref="editselect" v-model="editForm.area_province" @change="provinceChange" placeholder="请选择">
                 <el-option v-for="province in provinces" :label="province.name"  :value="province.id"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="城市">
              <el-select v-model="editForm.area_city" @change="cityChange"   placeholder="请选择">
                <el-option v-for="city in cities" :label="city.name"  :value="city.id"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>

        </el-row>

        <el-form-item label="住址">
          <el-input
            v-model="editForm.address"
            type="textarea"
            :autosize="{ minRows: 2, maxRows: 4}"
            placeholder="请输入内容">
          </el-input>
        </el-form-item>
      </el-tab-pane>
      <el-tab-pane label="身份证照" name="second">
        <el-row>
          <el-col :span="24">
             <el-form-item label="手持身份证照">
                  <el-upload
                   class="card_img"
                   action="{:U('Upload/index2')}" 
                   accept="image/jpeg,image/png,image/jpg,image/gif,image/bmp"
                   :on-success="editCardImg" 
                   :data="pathInfo"
                   :headers="xuploadheader"
                   :multiple="false"
                   :show-upload-list="false"
                   :before-upload="beforeAvatarUpload">
                   <img v-if='editForm.card_img' :src="'__ROOT__' + editForm.card_img" alt="" style="max-width: 400px; max-height:300px;">
                   <i  v-else class="el-icon-plus avatar-uploader-icon"></i>
                </el-upload>
              </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="24">
             <el-form-item label="身份证正面照">
                  <el-upload
                   class="card_front"
                   action="{:U('Upload/index2')}" 
                   accept="image/jpeg,image/png,image/jpg,image/gif,image/bmp"
                   :on-success="editCardFront" 
                   :data="pathInfo"
                   :headers="xuploadheader"
                   :multiple="false"
                   :show-upload-list="false"
                   :before-upload="beforeAvatarUpload">
                   <img v-if='editForm.card_front' :src="'__ROOT__' + editForm.card_front" alt="" style="max-width: 400px; max-height:234px;">
                   <i  v-else class="el-icon-plus avatar-uploader-icon"></i>
                </el-upload>
              </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="24">
             <el-form-item label="身份证反面照">
                  <el-upload
                   class="card_back"
                   action="{:U('Upload/index2')}" 
                   accept="image/jpeg,image/png,image/jpg,image/gif,image/bmp"
                   :on-success="editCardBack" 
                   :data="pathInfo"
                   :headers="xuploadheader"
                   :multiple="false"
                   :show-upload-list="false"
                   :before-upload="beforeAvatarUpload">
                   <img v-if='editForm.card_back' :src="'__ROOT__' + editForm.card_back" alt="" style="max-width: 400px; max-height:234px;">
                   <i  v-else class="el-icon-plus avatar-uploader-icon"></i>
                </el-upload>
              </el-form-item>
          </el-col>
        </el-row>
      </el-tab-pane>
    </el-tabs>


  
    
  </el-form>
  <div slot="footer" class="dialog-footer">
   <include file="Common:_edit" />
  </div>
</el-dialog>